<fieldset>
<legend>INFORMATIONS</legend>
		<form class="formGestion" action="admin/informations/modifInformations.php" method="post">
			<table>
			<?php
			require_once ('../../connexion.php');
			try{
				$sql1='SELECT * FROM informations WHERE libelle!=:newsletter';
				$select = $connection->prepare($sql1, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));
				$select->execute(array(':newsletter' => 'newsletter'));
				while($enregistrement = $select->fetch(PDO::FETCH_OBJ)){
					$lib=$enregistrement->libelle;
					$modifLib=$enregistrement->libelle;
					switch ($modifLib) {
						case "Cp/Ville":
							$modifLib="cpVille";
							break;
						case "Pays/Departement":
							$modifLib="paysDepartement";
							break;
						case "Raison Sociale":
							$modifLib="raisonSociale";
							break;
						case "Date de création":
							$modifLib="dateCreation";
							break;
						case "Prénom":
							$modifLib="prenom";
							break;
						case "Accès":
							$modifLib="acces";
							break;
					}					
					?>
						<tr>
							<td><label for="<?php echo $modifLib; ?>"><?php echo $lib; ?></label></td>
							<td><input id="<?php echo $modifLib; ?>" name="<?php echo $modifLib; ?>" type="text" value="<?php echo $enregistrement->valeur;?>"/></td>
						</tr>
					<?php 
					}
				
				try{
					$sql2='SELECT * FROM informations WHERE libelle=:newsletter';
					$select2 = $connection->prepare($sql2, array(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));
					$select2->execute(array(':newsletter' => 'newsletter'));
					$enregistrement2 = $select2->fetch(PDO::FETCH_OBJ);
					?>
					<tr>
						<td><label for="<?php echo $enregistrement2->libelle;?>"><?php echo $enregistrement2->libelle; ?></label></td>
						<td><textarea name="<?php echo $enregistrement2->libelle;?>" rows="5" cols="31"><?php echo $enregistrement2->valeur;?></textarea></td>
					</tr>
					<?php
				}catch(Exception $e){
					echo "<h3 class='error'>Impossible de charger l'information newsletter<h3 class='error'>";
				}		
			}catch(Exception $e){
				echo "<h3 class='error'>Impossible de charger les informations</h3>";
			}
			?>
				<tr>
					<td class="center" colspan="2">
						<input class="inputAction" type="submit" value="Sauvegarder"/>				
						<input class="inputAction" type="reset"/>
					</td>
					
				</tr>
			</table>
		</form>
</fieldset>